package com.neusoft.databus.policy.expression.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.neusoft.databus.common.bean.CommandBean;
import com.neusoft.databus.policy.bean.EventBean;
import com.neusoft.databus.policy.event.PolicyEventParser;
import com.neusoft.databus.policy.expression.ExpressionHandler;
import com.neusoft.databus.policy.expression.PolicyExpressionParser;

/**
 * 策略处理类
 * 
 * @author naxiang
 */
public abstract class PolicyExpressionHandler implements ExpressionHandler {

    @Autowired
    protected PolicyEventParser policyEventParser;
    @Autowired
    protected PolicyExpressionParser policyExpressionParser;

    public abstract void execute(CommandBean commandBean);

    /**
     * 发送到业务分析器
     * 
     * @param triggerResult
     */
    protected void sendResult(EventBean eventBean) {
        policyEventParser.receiveEvents(eventBean);
    }
}
